<?php
	class RelatedPostWidget extends CWidget{
		public $post_category_id;
		public $post_id;

		public function run(){
			$posts = Post::model()->findAllByAttributes(array('post_category_id' => $this->post_category_id), 
														array('order' => 'created_date DESC', 'condition' => 'id != :id', 
															'params' => array('id' => $this->post_id),
															'limit' => 3));
			$data['posts'] = $posts;

			$this->render('relatedpost', $data);
		}
	}
?>